package com.ieheima.demo;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class PropertiesClass02 {
    public static void main(String[] args) throws IOException {
        Properties prop = new Properties();
        FileReader fr = new FileReader("a.properties");
        prop.load(fr);
        fr.close();
        System.out.println(prop);

        Properties pro = new Properties();
        pro.setProperty("zhangsan","23");
        pro.setProperty("lisi","24");
        pro.setProperty("wangwu","25");
        FileWriter fw = new FileWriter("b.properties");
        pro.store(fw,"我的配置文件");
        fw.close();
        System.out.println(pro);
    }
}
